package com.yunda.nebula.gateway.core.entity;

import lombok.Data;

/**
 * \* User: wei.zhang
 * \* Date: 2020/9/17 17:46
 * \* Description:
 *
 * @author wei.zhang
 * \
 */
@Data
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;

    public Result() {
    }

    public static Result data(Object data){
        Result result = new Result();
        result.setData(data);
        result.setCode(200);
        return result;
    }

    public static Result failed(int code,String msg){
        Result result = new Result();
        result.setMsg(msg);
        result.setCode(code);
        return result;
    }

}
